<?php
include '../common.php';
if(!$_COOKIE['name']){
    exit('请先登录在回复');
}
$rule = [
    'content' => ['kong','回复内容不能为空'],
];
$a = panduan($rule);
if($a['code'] == 0){
exit($a['msg']);
}
$publish_id   = (int)trim($_POST['publish_id']);
$publish_name = trim($_POST['publish_name']);
$content      = trim($_POST['content']);
$name         = $_COOKIE['name'];
$time         = time();
$permissions  = '0';

$sql  = "INSERT INTO publish_revert (publish_id,publish_name,name,content,permissions,hour) VALUES ('$publish_id','$publish_name', '$name','$content','$permissions','$time')";
$row = insert($sql,$DB);
if (!$row) {
	exit('增加失败');
}
header("location:../requer.php?id=$publish_id",302);